/*
 *  SyncIT , easy synchronization of files between computers and devices.
 *  Copyright (C) 2011  Christian Masus <cmasus(at)gmail.com>
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version. If redistributing and/or modifying
 *  this file, this notice must be included in the redistributed or
 *  modified copy.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package gui.javagui;

import java.awt.Color;
import java.awt.Font;

import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;

@SuppressWarnings("serial")
public class StatusBar extends JPanel {

	private JLabel label;
	private Color defaultColor;

	public StatusBar() {
		setLayout(new BoxLayout(this, BoxLayout.X_AXIS));

		label = new JLabel();
		defaultColor = label.getForeground();
		Font font = label.getFont();
		font = font.deriveFont(Font.PLAIN);
		label.setFont(font);

		add(label);

		setMessage("Ready");
	}

	public void setMessage(String message) {
		label.setForeground(defaultColor);
		label.setText(" " + message);
	}

	public void setErrorMessage(String message) {
		label.setForeground(Color.red);
		label.setText(" " + message);
	}

}
